using huqiang.Core.HGUI;
using System;
using UnityEngine;
using huqiang.UIComposite;
using huqiang.UIEvent;
using huqiang;
using huqiang.Data;
using huqiang.UIModel;
using huqiang.Core.UIData;
using System.IO;
using UnityEngine.TextCore;
using UnityEngine.TextCore.LowLevel;

public class HTextPage:UIPage
{
    //反射UI界面上的物体
    class View
    {
        public HText text;
        public TextBox textBox;
        public InputBox inputBox;
    }
    View view;
    public override void Initial(UIElement parent, object dat = null)
    {
        base.Initial(parent, dat);
        view = LoadUI<View>("baseUI", "TextPage");//"baseUI"创建的bytes文件名,"page"为创建的页面名
        InitialData();
        InitialEvent();
    }
    void InitialData()
    {
        CustomFont font = new CustomFont(ElementAsset.FindTexture(null, "icons"));
        var sp = ElementAsset.FindSprites(null, "icons", new string[] { "Badge1", "Badge2", "Badge3l", });
        string str = "123";
        for (int i = 0; i < 3; i++)
            font.AddCharMap(str[i], sp[i], 66);
        view.text.customFont = font;
        view.text.Text = "1302254😝";
        view.textBox.customFont = font;
        view.textBox.Text = "13😝37682";
    }
    void InitialEvent()
    {

    }
}
